/********************************************************************************/
/* Projekt  Inverter3                                                             */
/* Autor:   Gerhard Woelfl                                                      */
/* Datum:   06.07.2014                                                          */
/* Changes: 06.07.2014: Initial Version                                         */
/*                                                                              */
/********************************************************************************/

#include <xc.h>
#include <stdint.h>

#ifndef __MC_CODE_H__
#define __MC_CODE_H__

extern uint16_t revs;
extern uint16_t speed;
extern uint16_t actAngle;

extern int16_t ia, ib, id, iq, sin_phi, cos_phi;
extern int16_t idDemand, iqDemand;
extern int16_t vd,vq;
extern int16_t va,vb;

extern int16_t idPidErr[3];
extern int16_t iqPidErr[3];

extern int16_t PidKpId;
extern int16_t PidKiId;
extern int16_t PidKdId;

extern int16_t PidKpIq;
extern int16_t PidKiIq;
extern int16_t PidKdIq;

extern int16_t idPidGain[3];
extern int16_t iqPidGain[3];

// Function Prototypes **********************************************************
void mcInit(void);
void mcCtrl(void);

#endif